home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc1_2_x / popupmen.sit / PopUpMenu 2.0b2 / card_4952.txt < prev    next >
Text File  |  1989-09-13  |  2KB  |  91 lines

  1. -- card: 4952 from stack: in.0b2
  2. -- bmap block id: 0
  3. -- flags: 4000
  4. -- background id: 3155
  5. -- name: 
  6. ----- HyperTalk script -----
  7. -----------------------------------------------------------------------
  8. -- openCard
  9. -----------------------------------------------------------------------
  10. on openCard
  11.   global style, styles, styleItems
  12.  
  13.   -- show card field "styles"
  14.   put card field "styles" into styles
  15.   put "Plain,Bold,Italic,Underline,Outline,Shadow" into styleItems
  16.   put 1 into style
  17.  
  18.   set textStyle of card button "Example" to item style of styleItems
  19.  
  20.   pass openCard
  21. end openCard
  22.  
  23. -----------------------------------------------------------------------
  24. -- doPopUp
  25. -----------------------------------------------------------------------
  26. on doPopUp
  27.   global style, styles, styleItems
  28.  
  29.   get PopUpMenu( styles, style )
  30.  
  31.   if it is not empty then
  32.     put it into style
  33.     set the textStyle of the target to item it of styleItems
  34.   end if
  35. end doPopUp
  36.  
  37.  
  38.  
  39.  
  40. -- part 1 (button)
  41. -- low flags: 00
  42. -- high flags: A004
  43. -- rect: left=192 top=168 right=190 bottom=292
  44. -- title width / last selected line: 0
  45. -- icon id / first selected line: 0 / 0
  46. -- text alignment: 1
  47. -- font id: 0
  48. -- text size: 12
  49. -- style flags: 0
  50. -- line height: 16
  51. -- part name: Example
  52. ----- HyperTalk script -----
  53. on mouseDown
  54.   doPopUp
  55. end mouseDown
  56.  
  57.  
  58. -- part 2 (field)
  59. -- low flags: 80
  60. -- high flags: 0004
  61. -- rect: left=169 top=227 right=329 bottom=256
  62. -- title width / last selected line: 0
  63. -- icon id / first selected line: 0 / 0
  64. -- text alignment: 0
  65. -- font id: 3
  66. -- text size: 12
  67. -- style flags: 0
  68. -- line height: 16
  69. -- part name: Styles
  70.  
  71.  
  72. -- part contents for background part 10
  73. ----- text -----
  74. Styled Items
  75.  
  76. To set an itemΓÇÖs style prefix the text of the item with either
  77.  
  78. ┬á┬á┬á┬áΓÇ£<BΓÇ¥ for bold, 
  79. ┬á┬á┬á┬áΓÇ£<IΓÇ¥ for italic, 
  80. ┬á┬á┬á┬áΓÇ£<UΓÇ¥ for underline, 
  81. ┬á┬á┬á┬áΓÇ£<OΓÇ¥ for outline, or
  82. ┬á┬á┬á┬áΓÇ£<SΓÇ¥ for shadow.
  83.  
  84. -- part contents for card part 2
  85. ----- text -----
  86. Plain
  87. <BBold
  88. <IItalic
  89. <UUnderline
  90. <OOutline
  91. <SShadow